
; macroinstruction for making import section

macro library [name,string] {
forward
    local _label
    if ~ name#.needed
    dd 0,0,0,RVA _label,RVA name
    end if
common
    dd 0,0,0,0,0
forward
    if ~ name#.needed
    _label db string,0
;    display 'Import from:', string, $0d, $0a
    end if
 }

macro import name,[label,string]
 { common
    name:
   forward
    if used label
     local _label
     label dd RVA _label
    end if
   common
    if $ > name
     name#.needed = FALSE
     dd 0
    else
     name#.needed = TRUE
    end if
   forward
    if used label
    _label dw 0
           db string,0
;      display $09, string, ', ', $27, string, $27, ',', $09, $09, $09, '\', $0d, $0a
    end if
  }


macro U_library [name,string]
 { forward
     local _label
     dd 0,0,0,RVA _label,RVA name
   common
     dd 0,0,0,0,0
   forward
    _label db string,0
 }


macro U_import name,[label,string]
 { common
    name:
   forward
     local _label
     label dd RVA _label
   common
     dd 0
   forward
    _label dw 0
           db string,0
  }


macro ImportLib [lib] {
forward
    local _label
    if ~ lib#.needed
      dd 0, 0, 0, RVA _label, RVA lib
    end if

common
    dd 0, 0, 0, 0, 0

forward
  if ~ lib#.needed
    _label db `lib#'.dll', 0
  end if

forward
  fake@inc "%finc%\win32\apia\"#`lib#".inc"
}

fake@inc fix include
